<?php

if (!defined('BASEPATH'))
    exit('No direct script access allowed');

class Beheren extends CI_Controller {

    // +----------------------------------------------------------
    // | Trainingsessies
    // +----------------------------------------------------------
    // | KHK - 2 TI4 - 2014-2015
    // +----------------------------------------------------------
    // | Beheren Controller
    // |
    // +----------------------------------------------------------
    // | Nicola Beysen
    // +----------------------------------------------------------

    public function __construct() {
        parent::__construct();
        $this->load->helper('form');
        
        if(! $this->authex->loggedIn()) {
                redirect('home/login');
            } else {
                $user = $this->authex->getUserInfo();
                if($user->accountType->accountType < 5) {
                    redirect('home/geentoegang');
                }
            }
            
    }

    public function index() {

        $data['user'] = $this->authex->getUserInfo();
        $data['activeItem'] = 'Beheren';

        $partials = array('header' => 'main_header',
            'content' => 'beheren/main_beheren',
            'footer' => 'main_footer',
            'topmenu' => 'main_topmenu',
            'sidemenu' => 'main_sidemenu',
            'script' => 'main_script');

        $this->template->load('main_master', $partials, $data);
    }

}
